import {Component, Input, OnInit} from '@angular/core';
import {BsModalRef} from 'ngx-bootstrap';
import {Role} from '../role.model';

@Component({
  selector: 'app-role-edit',
  templateUrl: './role-edit.component.html'
})
export class RoleEditComponent implements OnInit {
  title: string;
  isCancel: boolean = true;
  role: Role;

  constructor(public bsModalRef: BsModalRef) {
  }

  ngOnInit() {
  }

  btnCloseClick() {
    this.bsModalRef.hide();
  }

  btnConfirmClick() {
    this.isCancel = false;
    this.bsModalRef.hide();
  }

  statusChange(a: boolean) {
    if (a) {
      this.role.status = 1;
    } else {
      this.role.status = 0;
    }
  }

}
